package com.oig.common.exception;

import org.springframework.http.HttpStatus;

public class ServiceException extends RuntimeException {
	private static final long serialVersionUID = 1L;
	
	private int code = HttpStatus.INTERNAL_SERVER_ERROR.value();

	public int getCode() {
		return code;
	}


	public ServiceException(String message){
		super(message);
	}
	
	public ServiceException(int code, String message){
		super(message);
		this.code = code;
	}

	public ServiceException(ErrorCodeEnum error){
		super(error.getErrmsg());
		this.code = error.getCode();
	}
}
